<extend name="Base:base" />
<block name="title"><title>约吧管理</title></block>
<block name="content">
<link href = "__PUBLIC__/Css/publish.css" type = "text/css" rel = "stylesheet"/>
<script type="text/javascript" src="__PUBLIC__/Js/jquery-1.9.1.min.js"></script>
	<div id="content" align="center">		
		<div id="user" >
			<p style="margin-left:-650px; font-size:20px; color:#1d353f; font-weight:bold;">约吧列表</p>
			<div id='addBtn'><input type="button" value="添加约吧" id="btn" onclick="javascript:window.location.href = '__CONTROLLER__/add';"></div>
			<hr width="750px"/>
			<table style="width:750px;"">
			<tr style="color:#1d353f;"><th>序号</th><th>昵称</th><th>内容</th><th>发布时间</th><th>图片</th><th>操作</th><tr>
			<foreach name="list" item="publish">
			<tr>
				<td style="width:38px;"><if condition="($_GET['p'] eq 0)">{++$i}<else />{++$i + ($_GET['p']-1) * 7}</if></td>
				<td style="width:70px;">{$publish['nickname']}</td>
				<td style="width:120px;"><a href="javascript:void(0)" style='text-decoration:none;' title="{$publish['allcontent']}">{$publish['content']}</a></td>
				<td style="width:150px;">{$publish['ctime']|date='Y-m-d H:i:s',###}</td>
				<td style="width:280px;"><img height="90px" width="90px"src="{$publish['pic0']}"/><img height="90px" width="90px" src="{$publish['pic1']}"/><img height="90px" width="90px" src="{$publish['pic2']}"/></td>
				<td><a href="javascript:void(0)" onclick="scPublish({$publish['id']})">
					<img src="__PUBLIC__/Img/delete.png" /></a></td>
			</tr>
			</foreach>	
			</table>
		</div>
		<div id="count" align="center">共{$count}条</div>	
		<div id="page" align="center">{$page}</div>	
	</div>
<script type="text/javascript">
var delPublish = '{:U("Publish/del",'','')}';
function scPublish(i){
	var id = i;
	$.post(delPublish,{id:id},
		function(data){
			if(data.status==1){
				alert("删除成功！");
				setTimeout(function(){window.location.reload();},1000);
			}else{
				alert("删除成功！");
			}
		},
	'json');
}
function test(){
	alert(1);
}
</script>
</block>
